package com.hxd.mall.module.usercenter.order

import com.hxd.mall.module.usercenter.home.OrderListBean
import com.hxd.mall.network.base.BaseRequest
import com.hxd.mall.network.service.IMeFunctionApi
import com.hxd.mall.network.service.ManagerFunctionApi.mIMeFunctionApi
import com.hxd.mall.utils.open.ToastUtil
import javax.inject.Inject

/**
 * @author zhaoyong
 * @description:
 * @date :2019/7/17 11:08 AM
 */
class OrderQueryPresenter @Inject constructor(var mView: IOrderQueryView) : IOrderQueryPresenter {

    override fun getData(pageNum: Int, pageSize: Int, status: String) {
        BaseRequest.requestFinishRefresh(mIMeFunctionApi.getOrderList(pageNum, pageSize, status), mView, {
            mView.finishRefresh()
            mView.getListInfo(it)
        }, {
            mView.finishFailRefresh()
            ToastUtil.showToast(it.msg ?: "")
        })
    }

//    override fun getData(isRefresh: Boolean, pageNum: Int, pageSize: Int, status: String) {
//        BaseRequest.request(mIMeFunctionApi.getOrderList(pageNum, pageSize, status), mView, {
//            mView.showData(it)
//        }, {
//            ToastUtil.showToast(it.msg ?: "")
//        })
//    }


    override fun getVersionInfo() {
        /*BaseRequest.request(mMainFunctionApi!!.versionInfo, {
            mView.showData(it)
        }, {
            Logger.i("request fail")
        }, false)*/
    }
}